<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>猜数字</title>
</head>
<body>
    <h5>猜数字</h5>
    请输入你要猜的文字:<input type="text" id="text">
    <br>
    <button id="generate">生成数字</button>
    <button id="guess"> 我猜</button>
    <script>
        var button1=document.getElementById('guess');
        var button2=document.getElementById('generate');
        var text=document.getElementById('text');
        function radom(){
            return Math.floor(Math.random()*10+0.1);
        }
        var number;
        button2.onclick=function (){
            number=radom();
        }
        button1.onclick=function (e){

        }
    </script>
</body>
</html>